
<?php 
session_start();
//header('Content-Type: application/json');
$urlback	=	$_GET['url'];
//print_r($_SESSION);
//die($urlback);
if(isset($_SESSION['user']))
{
	$user	=	json_encode($_SESSION['user']);
	
	//die($user);
	
	//die("<div id='dUser'><input id='xxx' value='".$_SESSION['user']."' \/></div>");
	//echo "<script></script>";
}
else
{
	//$user	=	json_encode(null);
	echo "<script>window.close();</script>";
	
}

echo "<script>window.opener.location.href='".$urlback.(strpos($urlback, '?') ? '&' : '?')."auth=1&user=$user';window.close();</script>";
//echo "<script>window.opener.location.href='".$urlback."&auth=1&user=$user';window.close();</script>";

echo "<script>opener.location.reload(true);window.close();</script>";

//die("<h1>qqqqqqqqqqqqqqqqq</h1>");
die(json_encode(null));

?>